use lib qw(D:\Data\Perl\devel\TemplateEnginePrptotype\lib);

use Template5::DTD;
use Data::Dump;
use Test;

#------------------------------------------------------------------------------- 
plan();
my $dtd = Template5::DTD->new();

my $dtd_template_elm  = $dtd->element_create("http://region35.ru/template5/template");
my $dtd_attr_elm      = $dtd->element_create("http://region35.ru/template5/attr");
my $dtd_container_elm = $dtd->element_create("http://region35.ru/template5/container");
my $dtd_html_elm      = $dtd->element_create("html");

my $dtd_info_elm = $dtd->element_create("http://region35.ru/template5/info/info");
my $dtd_parent_elm = $dtd->element_create("http://region35.ru/template5/info/parent");

my $dtd_body_elm = $dtd->element_create("body");
my $dtd_h1_elm = $dtd->element_create("h1");

#print $dtd->element_localname($dtdelm);
#print "\n";

#print $dtdtmeplayeelm->child_allowed($dtdtattrelm);

ok($dtd_template_elm->child_allowed($dtd_html_elm), 1, 'template -> <any html>');
ok($dtd_html_elm->child_allowed($dtd_template_elm), 0, '<any html> -> template');
ok($dtd_container_elm->child_allowed($dtd_html_elm), 1, 'container -> <any html>');
ok($dtd_html_elm->child_allowed($dtd_container_elm), 1, '<any html> -> container');
ok($dtd_html_elm->child_allowed($dtd_html_elm), 1, '<any html> -> <any html>');
ok($dtd_html_elm->child_allowed($dtd_attr_elm), 1, "<any html> -> attr");
ok($dtd_attr_elm->child_allowed($dtd_html_elm), 0, "attr -> <any html>");
ok($dtd_template_elm->child_allowed($dtd_attr_elm), 0, "template -> attr");
ok($dtd_container_elm->child_allowed($dtd_template_elm), 0, "container -> template");
ok($dtd_container_elm->child_allowed($dtd_attr_elm), 0, "container -> attr");
ok($dtd_container_elm->child_allowed($dtd_container_elm), 1, "container -> container");
ok($dtd_container_elm->child_allowed($dtd_info_elm), 0, "container -> info");
ok($dtd_template_elm->child_allowed($dtd_info_elm), 1, "template -> info");
ok($dtd_template_elm->child_allowed($dtd_attr_elm), 0, "template -> attr");
ok($dtd_template_elm->child_allowed($dtd_parent_elm), 0, "template -> info::parent");
ok($dtd_info_elm->child_allowed($dtd_parent_elm), 1, "info -> info::parent");
ok($dtd_info_elm->child_allowed($dtd_info_elm), 0, "info -> info");
ok($dtd_body_elm->child_allowed($dtd_h1_elm), 1, "starnge ref");
#print 

